-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(actix): Update Healthcheck Actor [INGEST-1481] #1374
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note for reviewers: The actual fix is in 52a7459. |
jan-auer
approved these changes
Aug 2, 2022
tobias-wilfert
added a commit
that referenced
this pull request
Aug 3, 2022
As part of the effort to future-proof Relay as outlined here #1374 the goal is to use the standard Futures instead of the older version of the crate. With this effort currently under way this PR refactors the system by changing `futures` to `futures01` and `futures03` to `futures`. As such it builds further on the changes made here #1374.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
General
As part of the effort to future-proof Relay, this PR updates the
Healthcheck
Actor to work with standardFutures
instead of the former
futures
crate. It also moves away fromactix
internally.The bulk of the changes are to the healthcheck.rs file with minor
changes to other files to make it work with the reaming system. Some
code that is needed to interface with the current system can be removed
once the remaining system has been updated as well.
Design Choices
loop in healthcheck.rs using
tokio
. Note that this does currentlynot allow for concurrent execution, which was deemed sufficient for
the
Healthcheck
service for the moment.Healthcheck
service does not only need to handle theIsHealthy
messages but also handle a
Shutdown
message. The special thing aboutthat message is that in the current system the
Controller
can justsend out
Shutdown
messages to all actors without needing to knowanything about the internals of the actors. This can be achieved
through a
watch
channel.The
Controller
has the sender and services (subscribiers) haveclones of the receiver. There is a second message handle loop inside
the Actors that receives the Shutdown message and forwards it to the
primary message handle loop. This will be revised in a follow-up PR.
SystemRegistry
remains in place, however for thatto work with the Tokio runtime a copy of the
System
needs to beavailable in each Tokio runtime thread. This is achieved by using the
on_thread_start
,and can be removed once actix is gone.
Healthcheck
service we currently use alazy_static
, a minimal viable Registry of sorts.Future Steps
might be nice to refactor the system by changing:
futures
-->futures01
futures03
-->futures
Healthcheck
service only allows forlimited parallelization. As such, it might be interesting to use
channels internally to protect the internal resource and allow for
greater parallelization.
Upstream
actor. This willrequire us to circle back and remove the hardcoded
bool
in thestruct Message<T>
.This is a resubmit of #1349